//package com.edu.nchu.study.news;
//
//import com.fasterxml.jackson.databind.ObjectMapper;
//
//import java.io.Serializable;
//import java.net.URI;
//import java.net.http.HttpClient;
//import java.net.http.HttpRequest;
//import java.net.http.HttpResponse;
//import java.nio.charset.Charset;
//import java.util.Map;
//import java.util.concurrent.CompletableFuture;
//import java.util.concurrent.TimeUnit;
//
//public class JDK11NewApi {
//
//
//    public static void main(String[] args) throws Exception {
//        //forecastType();
//        //newStringApi();
//        httpClient();
//    }
//
//    public static void forecastType() {
//        var avar = "test";
//        System.out.println("the value:" + avar + " the type:" + avar.getClass().getSimpleName());
//        avar = "btest";
//        System.out.println("the value:" + avar + " the type:" + avar.getClass().getSimpleName());
//    }
//
//    public static void newStringApi() {
//        var avar = "  java11 new string test   ";
//        System.out.println("original string:" + avar);
//        System.out.println("repeat string:" + avar.repeat(2));
//        System.out.println("trim string:" + avar.stripTrailing());
//        System.out.println("trim string:" + avar.stripLeading());
//        System.out.println("trim string:" + avar.strip());
//        System.out.println("trim string:" + avar.trim());
//        System.out.println("string count: " + avar.lines().count());
//        System.out.println("original string:" + avar);
//    }
//
//    public static void httpClient() throws Exception {
//
//        Map<String, ? extends Serializable> param = Map.of("name", "java11开cc发", "remark", "测试效率",
//                "startTime", System.currentTimeMillis(), "endTime", System.currentTimeMillis());
//        ObjectMapper om = new ObjectMapper();
//        String str = om.writeValueAsString(param);
//        System.out.println("the request param: " + str);
//        HttpClient httpClient = HttpClient.newHttpClient();
//        HttpRequest httpRequest = HttpRequest.newBuilder(URI.create("http://localhost:8082/cvgoapp/cv/experience/manage"))
//                .header("Content-Type", "application/json")
//                .POST(HttpRequest.BodyPublishers.ofString(str))
//                .build();
//
//
//        CompletableFuture<Void> future = httpClient.sendAsync(httpRequest, HttpResponse.BodyHandlers.ofString(Charset.defaultCharset()))
//                .thenApply(HttpResponse::body).thenAccept(System.out::println);
//        System.out.println("ccccccccccccccccccccccccc");
//
//        future.join();
//
//
//    }
//}
